#include <iostream>
#include <cstring>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>

using namespace std;

int main()
{
    signal(SIGCHLD, SIG_IGN);
    pid_t id = fork();
    if (id == 0)
    {
        int cnt = 2;
        while (cnt--)
        {
            printf("I am child process, pid: %d, ppid: %d\n", getpid(), getppid());
            sleep(1);
        }
        cout << "child process quit!!!" << endl;
        exit(0);
    }
   
    while (1)
    {
        printf("I am father process, pid: %d, ppid: %d\n", getpid(), getppid());
        sleep(1);
    }
    return 0;
}